<template>
  <ul>
    <li class="dynamic-item" v-for="item in contenr" :key="item.id">
      <div class="user-box">
        <img class="avatarUrl" :src="item.user.avatarUrl" alt="" />
        <div>
          <p>
            <span class="nickname">{{ item.user.nickname }}</span>
            <span class="share">分享</span>
          </p>
          <p class="eventTime">
            {{ item.eventTime | fmtDate("yyyy年MM月DD日") }}
          </p>
        </div>
      </div>
      <pre class="dynamic-content">
        {{ item.actName }}
      </pre>
    </li>
  </ul>
</template>

<script>
import { mapState } from "vuex";
export default {
  props: {
    contenr: {
      type: Array,
      default: () => [],
    },
  },
  computed: {
    ...mapState("loginStore", ["userInfo"]),
  },
};
</script>

<style lang="scss" scoped>
.dynamic-item {
  border-bottom: 1px solid #e8e8e9;
  padding: 20px 0;
  .user-box {
    display: flex;
    .avatarUrl {
      width: 45px;
      height: 45px;
      margin-right: 10px;
    }
    .share {
      font-size: 14px;
      color: #666;
      margin-left: 5px;
    }
    .nickname {
      color: #0c73c2;
      font-size: 14px;
    }
    .eventTime {
      color: #999;
      margin-top: 5px;
      font-size: 12px;
    }
  }
  .dynamic-content {
    color: #666;
    margin-top: 20px;
  }
}
</style>